/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mobiubiq.directory.client.frame;

import org.kalmeo.kuix.core.Kuix;
import org.kalmeo.kuix.core.model.DataProvider;
import org.kalmeo.kuix.widget.Screen;

/**
 *
 * @author Marnix Renne
 */
public abstract class DataProviderBaseFrame extends ScreenDefinitionBaseFrame {
    private DataProvider dataProvider;
    
    public DataProviderBaseFrame(String screenDefinition, DataProvider dataProvider) {
        super(screenDefinition);
        this.dataProvider = dataProvider;
    }
    
    protected void cleanUp() {
        super.cleanUp();
        dataProvider = null;
    }
    
    public DataProvider getDataProvider() {
        return dataProvider;
    }
    
    public void setDataProvider(DataProvider provider) {
        dataProvider = provider;
    }
    
    protected Screen loadScreen() {
        return Kuix.loadScreen(getScreenDefintion(), dataProvider);
    }
  }
